using System;
using System.Windows.Forms;
using BasecampRestAPI;
using BasecampUI;

namespace TestBasecampRestAPI.TestBasecampUI
{
	public class FakeCredentialsForm : ICredentialsForm
	{
		public static FakeCredentialsForm GetInstance()
		{
			return new FakeCredentialsForm();
		}
		private FakeCredentialsForm()
		{
		}

		#region Implementation of ICredentialsForm

		public DialogResult ShowDialog()
		{
			ShowDialogCalled = true;
			return ShowDialogFakeResult;
		}
		public bool ShowDialogCalled { get; private set; }
		public DialogResult ShowDialogFakeResult { private get; set; }

		public string UrlText
		{
			get { UrlTextGetCalled = true; return UrlTextGetFakeResult; }
			set { UrlTextSetCalled = true; UrlTextSetLastValue = value; }
		}
		public bool UrlTextGetCalled { get; private set; }
		public string UrlTextGetFakeResult { private get; set; }
		public bool UrlTextSetCalled { get; private set; }
		public string UrlTextSetLastValue { get; private set; }

		public string UserNameText
		{
			get { UserNameTextGetCalled = true; return UserNameTextGetFakeResult; }
		}
		public bool UserNameTextGetCalled { get; private set; }
		public string UserNameTextGetFakeResult { private get; set; }

		public string PasswordText
		{
			get { PasswordTextGetCalled = true; return PasswordTextGetFakeResult; }
		}

		public IRestWebService Service
		{
			get
			{
				ServiceGetCalled = true;
				return ServiceGetFakeResult;
			}
		}
		public bool ServiceGetCalled { get; private set; }
		public IRestWebService ServiceGetFakeResult { private get; set; }

		public void UserNameFocus()
		{
			FocusUserNameCalled = true;
		}
		public bool FocusUserNameCalled { get; private set; }

		public bool PasswordTextGetCalled { get; private set; }
		public string PasswordTextGetFakeResult { private get; set; }

		#endregion

		#region Implementation of IDisposable

		public void Dispose()
		{
			DisposeCalled = true;
		}
		public bool DisposeCalled { get; private set; }

		#endregion

		#region Implementation of IWin32Window

		public IntPtr Handle
		{
			get { throw new System.NotImplementedException(); }
		}

		#endregion
	}
}